const helper = new Helper(this);
const { opt, id, projectAreaCode, projectCode } = $event;
const { proxy, removeVideoFuse, queryQuotaByArea, renderTree } = window._videoAccess;
console.log($event);

async function handleAreaData() {
    const { areaRows, equipmentRows, fusesRows } = await queryQuotaByArea(projectAreaCode, projectCode);
    renderTree([...areaRows, ...equipmentRows, ...fusesRows], projectAreaCode);
}

if (opt.type === 'remove') {
    const content = '<dl><dt><h3>是否确定删除？</h3></dt><dd>删除后列表不再显示当前拼接内容。</dd></dl>'
    helper.confirm(content, {
        title: '删除',
        ok($template) {
            removeVideoFuse(id).then(res => {
                layer.msg('删除成功!');
                handleAreaData()
                $template.remove();
            });
        },
        cancel() {
            window.layer?.msg('取消');
        }
    });
}